<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<jsp:include page="/admin/jsp/common/HtmlHead.jsp"/>
<title>Insert title here</title>
	<script type="text/javascript" src="<%=request.getContextPath()%>/js/calendar/WdatePicker.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.9.1.min.js"></script>
	<script type="text/javascript">
	$(function(){
		$("#grade").change(function(){
			var cls = $("#class");
			cls.empty();
			if(this.value!=0){
				$.getJSON("<s:url action="getClassByGrade"/>",{grade:this.value},function(data){
					if(data){
						for(var i=0;i<data.length;i++){
							cls.append("<option value='"+data[i].id+"'>"+data[i].name+"</option>");
						}
					}
				});
			}
		});
	});
	</script>
</head>
<body>
	<s:form action="editDo" method="post">
		<s:hidden name="student.id"/>
		<table width="100%">
			<tr>
				<th>登录名</th>
				<td>
					<s:textfield name="student.loginName" disabled="true"/>
				</td>
			</tr>
			<tr>
				<th>密码</th>
				<td>
					<input name="student.pwd" type="password"/>
				</td>
			</tr>
			<tr>
				<td colspan="2">
				<hr/>
				</td>
			</tr>
			<tr>
				<th>所属班级</th>
				<td>
					年级:<s:select id="grade" list="gradeMap" headerKey="0" headerValue="请选择" value="grade">
					</s:select>班级：<s:select name="student.classId" id="class" list="%{getClassByGrade(grade)}" listKey="id" listValue="name"></s:select>
				</td>
			</tr>
			<tr>
				<th>姓名</th>
				<td>
					<s:textfield name="student.realName"/>
				</td>
			</tr>
			<tr>
				<th>性别</th>
				<td>
					<s:radio list="%{getI18nMap('system.gender')}" name="student.gender"/>
				</td>
			</tr>
			<tr>
				<th>出生日期</th>
				<td>
					<input type="text" name="student.birthday" class="Wdate" onclick="WdatePicker()" value="<s:date name="student.birthday" format="yyyy-MM-dd"/>"/>
				</td>
			</tr>
			<tr>
				<th>身份证号码</th>
				<td>
					<s:textfield name="student.identityNum"/>
				</td>
			</tr>
			<tr>
				<th>联系电话</th>
				<td>
					<s:textfield name="student.telPhone"/>
				</td>
			</tr>
			<tr>
				<th>QQ号码</th>
				<td>
					<s:textfield name="student.oicqNum"/>
				</td>
			</tr>
			<tr>
				<th>Email</th>
				<td>
					<s:textfield name="student.email"/>
				</td>
			</tr>
			<tr>
				<th>学员简介</th>
				<td>
					<s:textarea rows="5" cols="30" name="student.introduction" />
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<input type="submit" value="提交"/>
				</td>
			</tr>
		</table>
	</s:form>
</body>
<jsp:include page="/admin/jsp/common/errorMessage.jsp"/>
</html>